import 'package:flutter/material.dart';
import 'package:flutter_app_demo/ui_demo/ui_weather_forecast/generic/spinner_text.dart';

class MyAppBar extends StatelessWidget {
    
    final Function onMenuClick;
    final String weekString;
    
    const MyAppBar({Key key, this.onMenuClick, this.weekString}) : super(key: key);
    
    @override
    Widget build(BuildContext context) {
        return AppBar(
            //背景透明
            backgroundColor: Colors.transparent,
            //去掉悬浮背景阴影
            elevation: 0.0,
            //去掉左侧返回按钮
            automaticallyImplyLeading: false,
            
            centerTitle: false,
            title: Column(
                
                crossAxisAlignment: CrossAxisAlignment.start,
                
                children: <Widget>[

//                    Text(
//                        '星期一，6月10日',
//                        style: TextStyle(
//                            color: Colors.white,
//                            fontSize: 16.0
//                        ),
//                    ),
                    SpinnerText(text: weekString,),
                    
                    Text(
                        '北京',
                        style: TextStyle(
                            color: Colors.white,
                            fontSize: 24.0
                        )
                    
                    ),
                ],
            ),
            //自定义右侧按钮
            actions: <Widget>[
                IconButton(
                    icon: Icon(Icons.arrow_forward_ios),
                    onPressed: onMenuClick,
                )
            
            ],
        );
    }
}
